//
//  CYHomeVideoTableViewCell.m
//  cyydt
//
//  Created by chu on 2019/1/17.
//  Copyright © 2019 chu. All rights reserved.
//

#import "CYHomeVideoTableViewCell.h"

@implementation CYHomeVideoTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    UIImageView *playImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 50, 50)];
    playImageView.image = [UIImage imageNamed:@"zxm_bf"];
    playImageView.center = CGPointMake(kWindowW / 2, self.headImageView.frame.size.height / 2);
    [self.headImageView addSubview:playImageView];
    
    self.playtimeLabel.layer.cornerRadius = 23 / 2;
    self.playtimeLabel.layer.masksToBounds = YES;
    self.playtimeLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.5];

}

- (void)setModel:(CYProjectModel *)model{
    _model = model;
    self.playtimeLabel.hidden = NO;
    self.titleLabel.text = model.title;
    [self.headImageView sd_setImageWithURL:[NSURL URLWithString:model.cover_url] placeholderImage:[UIImage imageNamed:@"videoPlaceHolde"]];
    self.cateLabel.text = model.catname;
    self.zanLabel.text = [NSString stringWithFormat:@"%@点赞", model.like_number];
    self.timeLabel.text = model.created_time;
    if (![NSString stringIsNull:model.play_time_format]) {
        self.playtimeLabel.text = model.play_time_format;
    }else{
        self.playtimeLabel.text = @"";
        self.playtimeLabel.hidden = YES;
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
